.x-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  
  input {
    display: none;
    
    &:checked + .x-switch__slider {
      background: $color-primary;
      
      &::before {
        transform: translateX(20px);
      }
    }
  }
  
  &__slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ddd;
    border-radius: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
    
    &::before {
      content: '';
      position: absolute;
      height: 20px;
      width: 20px;
      left: 2px;
      bottom: 2px;
      background: white;
      border-radius: 50%;
      transition: all 0.3s ease;
    }
    
    &:hover {
      background: $color-sub;
    }
  }
}
